package com.library.model.daoimple;

import java.util.List;

import org.springframework.orm.ibatis.support.SqlMapClientDaoSupport;

import com.library.model.dao.NoticeDAO;
import com.library.model.dto.notice.NoticeDTO;

public class NoticeDAOImple 
extends SqlMapClientDaoSupport implements NoticeDAO{

	public void insertNoticeWrite(NoticeDTO dto) {
		getSqlMapClientTemplate().insert("NoticeMap.insertNoticeWrite", dto);
		
	}

	@Override
	public List<NoticeDTO> getAllNotice() {
		return (List<NoticeDTO>)this.getSqlMapClientTemplate().queryForList("NoticeMap.getAllNotice");
	}

	@Override
	public NoticeDTO getNotice(int aSeq) {
		return (NoticeDTO)this.getSqlMapClientTemplate().queryForObject("NoticeMap.getNotice", aSeq);
	}

	@Override
	public NoticeDTO updateNotice(NoticeDTO dto) {
		getSqlMapClientTemplate().update("NoticeMap.updateNotice", dto);
		return dto;
		
	}

	@Override
	public void deleteNotice(int aSeq) {
		
		getSqlMapClientTemplate().delete("NoticeMap.deleteNotice", aSeq);
		
	}

}
